Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow union types to reuse the same member #948

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

AlixBa
Copy link
Contributor

@AlixBa AlixBa commented Jul 5, 2021

closes #826

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great! The only thing I'm wondering is: should we keep it inside an object when there is only 1? That way it would limit breaking changes with existing code and it makes things a bit cleaner in the normal case. What do you think?

@AlixBa
Copy link
Contributor Author

AlixBa commented Jul 6, 2021

Tried it.
I've kept the same old behavior for "not reused union members" and got "reused union members" out of the Union object using multiple sealed trait extend.

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ghostdogpr ghostdogpr merged commit 5496cec into ghostdogpr:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation Error when the same interface is used in multiple unions
2 participants